<?php

require_once "config.php";

function getRandomKeyword($file) {
    $file = dirname(__FILE__)."/".$file;
    $count = filesize($file) / (LINE_LENGTH + 1);
    $file = fopen($file, "r");
    $n = rand(0, $count - 1);
    fseek($file, $n * (LINE_LENGTH + 1));
    $line = fread($file, LINE_LENGTH);
    fclose($file);
    return trim($line);
}

// echo getRandomKeyword("adult_top_aligned")."!!!\n";

?>
